﻿using UnityEngine;
using System.Collections;

public class SensorField : Sensor {

	public WorldField field;
	public float range = 1;

	void FixedUpdate () {

		float f = 0.5f;
		f = field.getIntensity (gameObject.transform.position);
		if (range > 0) f /= range;
		f = Mathf.Clamp01 (f);

		output = (ushort)(65534.0f* f);
	
	}

}

